﻿using TraumaCenterSystem.Bll;
using TraumaCenterSystem.Model;
using System.Collections.Generic;
using System.Web.Mvc;

namespace TraumaCenterSystem.Controllers 
{
    public class HomeController : BaseController 
    {
        /// <summary>
        /// Index
        /// </summary>
        /// <returns></returns>
        public ActionResult Index() {
            return View();
        }

        /// <summary>
        /// 桌面
        /// </summary>
        /// <returns></returns>
        public ActionResult Desktop()
        {
            return View();
        }

        /// <summary>
        /// 初始化菜单
        /// </summary>
        /// <returns></returns>
        public ActionResult InitMenu()
        {
            List<MenuInfo> menuList = MenuManager.GetMenu((loginUser.IsWinform == 1 ? "administrator" : loginUser.Personnel_id), 3);
            return JsonDate(menuList);
        }

        /// <summary>
        /// 获取登录用户信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetLoginUser()
        {
            return JsonDate(loginUser);
        }
    }
}